﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

/// <summary>
///dds_users 的摘要说明
/// </summary>
public class dds_users
{
	public dds_users()
	{
		//
		//TODO: 在此处添加构造函数逻辑
		//
	}


    public int Login(string email,string pwd)
    {
        string sql = "select uid from dds_users where email='"+email+"' and pwd='"+pwd+"'";
        object obj=DataAccess.getInstance().ExecuteScalar(sql);
        return Convert.ToInt32(obj);
    }

    public bool Add(string email,string username,string pwd)
    {
        string sql = "insert into dds_users(email,username,pwd) values('" + email + "','" + username + "','" + pwd + "') select @@identity";
        object obj = DataAccess.getInstance().ExecuteScalar(sql);
        return (obj!=null);
    }


}
